home *** CD-ROM | disk | FTP | other *** search
/ Light ROM 1 / LIGHT-ROM 1 (Amiga Library Services)(1994).iso / ffdisks / d918.lha / MultiPlot / Rexx / Scripts / scaleY.mpt < prev    next >
Text File  |  1993-10-04  |  1KB  |  80 lines

  1. /* This script scales the Y values and Y errors of a selected set
  2. by a given amount */
  3.  
  4. port= 'MULTIPLOT.01'
  5. RESULT=''
  6. RC=0
  7.  
  8. /* Check Multiplot is running */
  9. options results
  10. if(~show('p',port)) then do
  11.   say "Please start Multiplot first"
  12.   exit 1
  13. end
  14. address value port
  15. 'QUERY'
  16. if(rc ~=0) then do
  17.   say "QUERY command failed!"
  18.   exit 1
  19. end
  20.  
  21. /* Check a PLOT WINDOW is activated */
  22. if(compare('PLOWIN',RESULT)<6) then do
  23.   'SAY Please select a PLOT WINDOW first'
  24.   exit 1
  25. end
  26.  
  27. /* Check a Data Set is selected and find out which one */
  28. 'PEEK 1 NOVALS'
  29. if(rc ~=0) then do
  30.   'SAY Please select a Data Set first'
  31.   exit 1
  32. end
  33. 'LAUNCH'
  34. 'QUE'
  35. setno=word(RESULT,words(RESULT))
  36. 'STOP'
  37.  
  38. /* Get scale factor and change Y values */
  39. 'PULL AREXX: Please enter scaling factor'
  40. scal=RESULT
  41. do i=1 to NOVALS
  42.   'SELECT SET 'setno
  43.   'SELECT POINT ' i
  44.   'SELECT REPLACE'
  45.   'PEEK 1'
  46.  
  47.   xvar=WORD(POINT,1)
  48.   yvar=WORD(POINT,2)
  49.   xhier=WORD(POINT,3)
  50.   xlower=WORD(POINT,4)
  51.   yhier=WORD(POINT,5)
  52.   yloer=WORD(POINT,6)
  53.  
  54.   POINT=DELWORD(POINT,1,6)
  55.  
  56.   yloer= yloer * scal
  57.   POINT=INSERT(yloer,POINT)
  58.  
  59.   yhier= yhier * scal
  60.   POINT=INSERT(' ',POINT)
  61.   POINT=INSERT(yhier,POINT)
  62.  
  63.   POINT=INSERT(' ',POINT)
  64.   POINT=INSERT(xlower,POINT)
  65.  
  66.   POINT=INSERT(' ',POINT)
  67.   POINT=INSERT(xhier,POINT)
  68.  
  69.   yvar= yvar * scal
  70.   POINT=INSERT(' ',POINT)
  71.   POINT=INSERT(yvar,POINT)
  72.  
  73.   POINT=INSERT(' ',POINT)
  74.   POINT=INSERT(xvar,POINT)
  75.   POKE 1
  76. end
  77.  
  78. /* Replot */
  79. 'FULLPLOT'
  80.